// ExcessRecordSet.cpp : implementation file
//

#include "stdafx.h"
#include "kwservercore.h"
#include "ExcessRecordSet.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CExcessRecordSet

//IMPLEMENT_DYNAMIC(CExcessRecordSet, CThreadSafeRecordset1)

CExcessRecordSet::CExcessRecordSet(CAdoConnection *pConnection)
	: CAdoRecordSet(pConnection)
{
	m_pConnection = pConnection;
	//{{AFX_FIELD_INIT(CExcessRecordSet)
	#ifdef ExcessRecordSet_New
		m_AutoId = _T("");
	#endif
    m_Time = CTime::GetCurrentTime();
	m_MonUnitId = _T("");
	m_State = 0;
	m_Value = 0.0f;
	m_CoalMineId = 0;
	m_MonUnitName = _T("");
	#ifdef ExcessRecordSet_New
	m_MonUnitType = _T("");
	m_SystemId = 0 ;
	//m_nFields = 9;//6;
	#else
	//m_nFields = 6;
	#endif

	//}}AFX_FIELD_INIT
	//m_nDefaultType = snapshot;
}


CString CExcessRecordSet::GetDefaultConnect()
{
  return _T("ODBC;DSN=KWSystem;UID=kwuser;PWD=1234");
}

CString CExcessRecordSet::GetDefaultSQL()
{
	return _T("[dbo].[ExcessRecord]");
}

void CExcessRecordSet::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CExcessRecordSet)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	#ifdef ExcessRecordSet_New
	RFX_Text(pFX, _T("[AutoId]"), m_AutoId);
	#endif
	RFX_Date(pFX, _T("[Time]"), m_Time);
	RFX_Text(pFX, _T("[MonUnitId]"), m_MonUnitId);
	RFX_Byte(pFX, _T("[State]"), m_State);
	RFX_Single(pFX, _T("[Value]"), m_Value);
	RFX_Long(pFX, _T("[CoalMineId]"), m_CoalMineId);
	RFX_Text(pFX, _T("[MonUnitName]"), m_MonUnitName);
	#ifdef ExcessRecordSet_New
	RFX_Text(pFX, _T("[MonUnitType]"), m_MonUnitType);
	RFX_Byte(pFX, _T("[SystemId]"), m_SystemId);
	#endif
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CExcessRecordSet diagnostics

#ifdef _DEBUG
void CExcessRecordSet::AssertValid() const
{
	//CRecordset::AssertValid();
}

void CExcessRecordSet::Dump(CDumpContext& dc) const
{
	//CRecordset::Dump(dc);
}
#endif //_DEBUG
